using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;


/// <summary>
/// Summary description for Stock
/// </summary>
public class Stock
{
	public Stock()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static void agregarStock(int cantidad)
    {
        SqlConnection conexion = null;

        try
        {
            conexion = Conexion.CrearConexion();
            IDbCommand comando = Conexion.CrearComando(conexion);

            comando.CommandType = System.Data.CommandType.StoredProcedure;
            comando.CommandText = "sp_agregar_stock";
            comando.Parameters.Add(Conexion.CrearParametro("@cantidad", cantidad));
            comando.ExecuteNonQuery();



        }
        finally
        {
            conexion.Dispose();
        }
    }
    public static void eliminarStock(int cod_marca)
    {
        SqlConnection conexion = null;

        try
        {
            conexion = Conexion.CrearConexion();
            IDbCommand comando = Conexion.CrearComando(conexion);

            comando.CommandType = System.Data.CommandType.StoredProcedure;
            comando.CommandText = "[sp_borrar_stock]";
            comando.Parameters.Add(Conexion.CrearParametro("@cod_marca", cod_marca));
            comando.ExecuteNonQuery();



        }
        finally
        {
            conexion.Dispose();
        }
    }
    public static void modificarStock(int cod_producto, int cantidad)
    {
        SqlConnection conexion = null;

        try
        {
            conexion = Conexion.CrearConexion();
            IDbCommand comando = Conexion.CrearComando(conexion);

            comando.CommandType = System.Data.CommandType.StoredProcedure;
            comando.CommandText = "[sp_modificar_stock]";
            comando.Parameters.Add(Conexion.CrearParametro("@cod_marca", cod_producto));
            comando.Parameters.Add(Conexion.CrearParametro("@cantidad", cantidad));
            comando.ExecuteNonQuery();



        }
        finally
        {
            conexion.Dispose();
        }
    }
}
